butane: report CEX kernel arg error once when both sources set - #2294
butane: report CEX kernel arg error once when both sources set#2294deepak0x wants to merge 1 commit into
Conversation
When both boot_device.luks.cex.enabled and a storage.luks root entry with cex.enabled are set, the missing 'rd.luks.key=/etc/luks/cex.key' kernel argument was reported twice at $.openshift.kernel_arguments. Consolidate the two independent checks into a single CEX-enabled flag and emit the error exactly once. Behavior and error path are unchanged. Fixes coreos#2285 Signed-off-by: Deepak Bhagat <deepak988088@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan includes up to 4 reviews per rolling hour; 1 remains after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)**/*.go📄 CodeRabbit inference engine (AGENTS.md)
Files:
docs/**⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (3)
📝 WalkthroughWalkthroughOpenShift 4.23 validation now combines boot-device and root-storage CEX settings before checking the required kernel argument. A regression test verifies one error, and the release notes document the fix. ChangesCEX validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change reports the missing CEX kernel argument error once instead of twice when both supported configuration sources are enabled, with no change to validation behavior or error location. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Config.Validateinbutane/config/openshift/v4_23_exp/validate.goreportedErrMissingKernelArgumentCextwice at$.openshift.kernel_argumentswhen bothboot_device.luks.cex.enabled: trueand astorage.luksroot entry withcex.enabled: truewere set.Two independent
if-blocks each calledr.AddOnError(...)when therd.luks.key=/etc/luks/cex.keykernel argument was absent, so both fired and the identical error was reported twice.Fix
Consolidate the two checks into a single
cexflag (set when either the boot-device CEX is enabled or any rootstorage.luksentry has CEX enabled) and emit the error exactly once when the flag is set and the kernel argument is missing. Behavior and error path are unchanged.Test plan
TestValidateConfigcase that sets both CEX sources and an empty kernel argument list, asserting exactly oneErrMissingKernelArgumentCexat$.openshift.kernel_arguments.go test ./butane/config/openshift/v4_23_exp/...passes.Fixes #2285
This PR ports the fix originally opened as coreos/butane#732 for coreos/butane#731, before butane was merged into ignition. It supersedes that PR and closes coreos/butane#731.
cc @prestist